﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace _14_.Net全套2
{
    class Program
    {
        static void Main(string[] args)
        {
            string[] ss = { "123", "2242", "222", "22sss222", "ssdaaf" };
            string max = getLongest(ss);
            Console.WriteLine(max);
            int[] nums = { 1, 2, 3, 45, 6, 7 };
            double avg = GetAvg(nums);
            string str = avg.ToString("0.00");
            Console.WriteLine(str);
            Console.WriteLine(avg);
            Console.ReadKey();
        }

        public static double GetAvg(int[] ss)
        {
            double avg = 0;
            for(int i = 0; i < ss.Length; ++i)
            {
                avg += ss[i];
            }
            avg /= ss.Length;
            return avg;
        }


        public static string getLongest(string[] s)
        {
            string max = s[0];
            for (int i = 1; i< s.Length; ++i)
            {
                if (max.Length < s[i].Length)
                    max = s[i];
            }
            return max;
        }
        //计算不定长度的数组的最大值
        public static int Max(params int[] num)
        {
            int max = 0;


            return max;
        }

    }
}
